<p:dialog xmlns="http://www.w3.org/1999/xhtml"
      	  xmlns:h="http://java.sun.com/jsf/html"
      	  xmlns:f="http://java.sun.com/jsf/core"
      	  xmlns:ui="http://java.sun.com/jsf/facelets"
      	  xmlns:p="http://primefaces.org/ui"
      	  modal="true"  resizable="true" width="40%"
		  widgetVar="dialogConsultarPlano" id="idDialogConsultarPlano" closable="true"
		  appendTo="@(body)" header="Consultar Plano"> 	
  	
	 <link rel="stylesheet" type="text/css" href="./estilos.css"/>  
<h:form id="formDialogConsultarPlano" prependId="false">
<h:panelGroup id="pgDialogConsultarPlano">
 	<p:messages id="messagesMatriculaConsultarPlano" autoUpdate="true" closable="true" /> 
    	<h:panelGrid columns="3" style="margin-right:10%;">  
            <h:outputLabel value="Código" styleClass="outputLabel"/>  
            <h:outputLabel value="Plano" styleClass="outputLabel"/>             
            <h:outputLabel />             
            <p:inputText value="#{planoBean.plano.idPlano}" styleClass="inputId"/>  
  			<p:inputText value="#{planoBean.plano.descricao}" styleClass="inputDescricao"/>  
  			<p:commandButton value="Consultar" actionListener="#{matriculaBean.findPlano}" process="@this" update="dataTablePlano" styleClass="commandButton" /> 
        </h:panelGrid> 
    <p:dataTable id="dataTablePlano" var="plano" value="#{matriculaBean.dmPlano}"  
    			 rowKey="#{plano.idPlano}"  selectionMode="single" style="padding-top:20px;" paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15" >  
        <f:facet name="header">Planos</f:facet>    
		<p:column style="text-align:center; float:center">  
            <f:facet name="header">  
                <h:outputText value="Código" />  
            </f:facet>  
            <h:outputText value="#{plano.idPlano}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Descrição" />  
            </f:facet>  
            <h:outputText value="#{plano.descricao}" />  
        </p:column>  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Período" />  
            </f:facet>  
            <h:outputText value="#{plano.periodo.descricao}" />  
        </p:column> 
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Valor" />  
            </f:facet>  
            <h:outputText value="#{plano.total}" >
            	<f:convertNumber type="currency" currencySymbol="R$ " maxFractionDigits="2" minFractionDigits="2"/>
            </h:outputText>  
        </p:column> 
        <p:column style="width:4%; text-align:center; float:center">  
        	<f:facet name="header">
        	 <h:outputText value="Adicionar" />
        	</f:facet>
         	<p:commandButton id="selectButtonEditar" actionListener="#{matriculaBean.selectPlano}" process="@this"  icon="ui-icon-circle-plus" title="Add" />
        </p:column> 
    </p:dataTable> 

 </h:panelGroup>
 </h:form>
</p:dialog>
